<extend name="Layout/index"/>
<block name='header'>
	
	<script src="__PUBLIC__/Js/jquery-1.8.2.js"></script>
</block>
<block name='main_content'>
  	<div style="width:970px"id="BAIHE" class="w">
 		<!--左部导航 -->
		<div id='momoleftCont'>
			<h3 style="font-size:18px">我的设置</h3>
			<ul>
				<li><a href='#'>我的头像</a></li>
				<li><a href='#'>相册</a></li>
				<li><a href='#'>编辑资料</a></li>
				<li><a href='#'>择偶条件</a></li>
			</ul>
			<h3 style="font-size:18px">我的互动</h3>
			<ul style="display:block">
				<li><a href='#'>我的问候</a></li>
				<li><a href='#'>我的邮件</a></li>
				<li><a href='#'>礼物</a></li>
				<li><a href='#'>谁看过我</a></li>
				<li><a href='#'>我看过谁</a></li>
				<li><a href='#'>我的关注</a></li>
				<li><a href='#'>我的粉丝</a></li>
			</ul>
			<h3 style="font-size:18px">我的日志</h3>
			<ul>
				<li><a href='#'>日志列表</a></li>
				<!-- <li><a href='#'>发表日志</a></li> -->
			</ul>
			<!-- <h3 style="font-size:18px">我的账号</h3>
			<ul>
				<li><a href='#'>交友账号</a></li>
				<li><a href='#'>在线充值</a></li>
				<li><a href='#'>会员服务</a></li>
			</ul> -->
		</div>
		<div id="rightDay">
			<!-- 心情日志 -->
			<div class="mood-post-form" style="padding-bottom:50px;">
				<div class="mood-title">
					<img src="__PUBLIC__/Home/dialy/mood.gif" alt="">
				</div>
				<div class="mood-post-content">
					<textarea class="mood-textarea" id="content" name="content"></textarea>
                   	<div style="padding-top:7px; height:30px;">
                        <div style="float:left; background:url(__PUBLIC__/Home/dialy/images/1.gif); width:26px; height:23px;" class="emotion">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
                        <div style="float:left;"><p style="font-size:13.5px;">表情</p></div>
                        <div style="float:right; background:#abcdef;color:#fff;width:28px;height:23px;padding:2px 5px;margin-right:13px;"  class="btn" id="sub" value="提交">发表</div>&nbsp;&nbsp;&nbsp;
                        <div style="float:right;margin-top:3px;"><p style="font-size:13.5px;">还能输入500字&nbsp;&nbsp;</p></div>
                    </div>
				</div>
				<div style="margin-top:30px;"></div>
				<div class="clear"></div>
					<ul>
					    <li class="divContent"></li>
						<volist name="list" id="vo">
							<li>
								<div  class="t1">
									<div class="userImg">
										<img  src="__PUBLIC__/Home/dialy/images/gender_1.gif" alt="">
									</div>
									<div class="t1t1">
										<div class="userInfo"><{$vo.name}>&nbsp;&nbsp;<{$vo.dutime|date="y-m-d H:i:s",###}></div>
										<div class="dataContent">
										<?php  
											$temp=htmlspecialchars_decode($vo['content']);
										  	// echo $temp.'<br>';
										  	echo htmlspecialchars_decode($temp);
										  ?>
										</div>
									</div> 
								</div>
							</li> 
						</volist>
					</ul>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
		<script>
			$(function(){
				$("#momoleftCont ul:first").show();
				$("#momoleftCont h3").click(function(){
					if ($(this).next('ul').is(':hidden')) {
						$(this).next('ul').slideDown();
					} else {
						$(this).next('ul').slideUp();
					}
				});
				$("#momoleftCont ul li").mouseenter(function(){
					$(this).css('background-color','#f5f5f5');
				});
				$("#momoleftCont ul li").mouseleave(function(){
					$(this).css('background-color','');
				});
			})
		</script>
		<script type="text/javascript" src="__PUBLIC__/Home/dialy/jquery.qqFace.js"></script>
		<script type="text/javascript">
		    $(function() {
		        $('.emotion').qqFace({
		            id: 'facebox', //表情ID
		            assign: 'content', //赋予到具体位置
		            path: '__PUBLIC__/Home/dialy/face/'	//表情路径
		        });
		        $("#sub").click(function() {
		            var content  = $("#content").val();
		            if(content.length==0){
		            	alert('请输入内容');return false;
		            }
		            var tempResult=replace_em(content);
		             // $(".dataContent").html(tempResult);	//转换成表情图片
		            $("#content").val('');
		           	$.ajax({
		           		type:"POST",
		           		url:"<{:U('Dialy/addContent')}>",
		           		data:{contentD:tempResult},
		           		dataType:"json",
		           		success:function(data){
		                  window.location.href="<{:U('Dialy/index')}>";
		           	 }
		           	});
		        });
		    });
		    function replace_em(str) { //表情符号替换成图片
		        str = str.replace(/\</g, '&lt;');
		        str = str.replace(/\>/g, '&gt;');
		        str = str.replace(/\n/g, '<br/>');
		        str = str.replace(/\[em_([0-9]*)\]/g, '<img src="__PUBLIC__/Home/dialy/face/$1.gif" border="0" />');
		        return str;
		    }
		</script>
</block>



